/**
 * @(#) CertificateFacade.as
 *
 * @date		2009. 02. 17.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	module facade (제증명신청)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다. 
 */
package com.skt.common_hr.approval
{
	import com.skt.common_hr.approval.controller.StartupCommand;
	import com.skt.common_hr.common.puremvc.CommonFacade;
	
	import flash.display.DisplayObject;
	 
	public class ApprovalFacade extends CommonFacade
	{
		public static const STARTUP:String 						= 'startup';
		public static const CLOSE_MODULE:String					= 'closeModule';
		public static const LOAD_APPROVAL_LIST_COMPLETE:String	= "loadApprovalListComplete";
		public static const LOAD_APPROVAL_LIST_FAILED:String	= "loadApprovalListFailed";
		
		
		public function ApprovalFacade( key:String )
		{
			super(key);	
		}
		
        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : ApprovalFacade 
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new ApprovalFacade( key );
            return instanceMap[ key ] as ApprovalFacade;
        }

        /**
         * Register Commands with the Controller 
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();            
            registerCommand( STARTUP, StartupCommand);
        }
       
        /**
         * Module의 시작점으로 Certificate.mxml의 creationComplete 이벤트에서 호출한다.
         *     
         */
        public function startup(app:Object) :void 
        {
        	//trace("send startup in Approval");
        	app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }
		
	}
}